﻿using AutoMapper;
using AutoMapperTest.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AutoMapperTest.Mappers
{
    public class MyMapProfile : Profile
    {
        public MyMapProfile()
        {
            CreateMap<User, UserDto>()
                .ForMember(des => des.Status,
                opt => opt.MapFrom(x => x.Status == 0 ? "正常" : "不可用")).ReverseMap();
        }
    }
}
